export const defaultState = {
  count: 100,
  city: '武汉',
  list: [],
  test: '测试 - 测试'
}

export const reducers = (state, action) => {
  const { type, payload } = action

  switch (type) {
    case 'changeCount':
      return { ...state, count: state.count + payload }
      break;

    case 'changeCity':
      return { ...state, city: payload }
      break;

    case 'changeTest':
      return { ...state, test: payload }
      break;

    case 'changeList':
      return { ...state, list: payload }
      break;

    default:
      return state
      break;
  }
}
